<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class UserProfile extends Model {

	//
	protected $table = 'user_profile';
	protected $fillable = ['uid','nickname','province','city','area','address','avatar','sex','contact_way','email'];

	public function province()
	{
		return $this->hasOne("App\Models\Area", "area_id", "province");
	}

	public function city()
	{
		return $this->hasOne("App\Models\Area", "area_id", "city");
	}

	public function area()
	{
		return $this->hasOne("App\Models\Area", "area_id", "area");
	}
}
